﻿using System;
using Phoenix.Framework;
using Phoenix.Tests.Controllers;
using Xunit;

namespace Phoenix.Tests.Framework
{
    public class DefaultControllerFactoryTests
    {
        [Fact]
        public void initialises_controller_on_creation()
        {
            // arrange
            var factory = new DefaultControllerFactory();
            var controllerActionContext = PhoenixObjectMother.CreateContext(new ControllerAction("Test", "Action", null));

            // act
            var controller = factory.Create<TestController>(controllerActionContext);

            // assert
            Assert.Equal(controllerActionContext, controller.Context);
        }
    }
}